<?php
/**
 * Abstrat singleton class for easier implementation of a singleton class. 
 *
 * @package api
 * @subpackage lang
 * @author Richard Fullmer <php-api@byu.edu>
 * 
 * @version 1.0
 */


/** 
 * Abstract Class Singleton
 *
 * Singleton implementation of a class.  Programmers wishing to use a singleton as a class should extend this class thereby ensuring that 
 * an instance of that class can never be created as it has a private constructor, and provides the singleton instance() method.
 *
 * @package api
 * @subpackage lang
 * @author Richard Fullmer <php-api@byu.edu>
 * 
 * @version 1.0
 */
abstract class Singleton {
	
	/**
	 * All child classes implement the instance() method to provide a Singleton interface.  Therefore, they should no have public 
	 * constructors.
	 */
    private function __construct() {} 
	
	/**
	 * Gets the currently instantiated object associated with this class, or creates on if not already created.
	 *
	 * @returns Singleton the current instance of this particular class.
	 */
	abstract static function instance();
}

?>